Zum Hauptinhalt springen
Version: 5.6

Core

ApplicationKeys

In der Klasse TimePunch.Enums.Core.ApplicationKeys sind die Applikationsschlüssel definiert. Diese können zur Abfrage der Benutzerlizenzen verwendet werden. Wichtige Methoden hierfür sind:

  • ValidateAuthentication
  • GetLicensedUserProfiles

The following constant values are defined:

public static class ApplicationKeys

{

/// <summary>

/// Application Key for TimePunch PRO

/// </summary>

public const string TIMEPUNCH_PRO = "Tp";

/// <summary>

/// Application Key for TimePunch ONE

/// </summary>

public const string TIMEPUNCH_ONE = "One";

/// <summary>

/// Application Key for TimePunch TEN

/// </summary>

public const string TIMEPUNCH_TEN = "Ten";

/// <summary>

/// Application Key for PZE Terminal

/// </summary>

public const string PZE_TERMINAL = "PZE";

/// <summary>

/// Application Key for PZE Watcher

/// </summary>

public const string PZE_WATCHER = "WAT";

/// <summary>

/// Application Key for PZE Studio

/// </summary>

public const string PZE_STUDIO = "STU";

/// <summary>

/// Application Key for PZE Studio

/// </summary>

public const string PZE_ONLINE = "ONL";

}

Kennwort mit MD5 Cryptography Provider hashen

Der folgende Code benutzt den MD5 Cryptography Provider um ein Passwort zu hashen. Das gehashte Passwort wird für die Anmeldung in der TpAuthentication Entität benötigt.

public static string MD5Hash(string text)

{

System.Security.Cryptography.MD5 md5

= new System.Security.Cryptography.MD5CryptoServiceProvider();

return System.Text.RegularExpressions.Regex

.Replace(BitConverter.ToString(

md5.ComputeHash(ASCIIEncoding.Default.GetBytes(text))), "-", "");

}